<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // const arr1 = [1, 2, 3]
      // console.log(arr1.indexOf(2))

      const arr2 = [
        {name: 'zs'},
        {name: 'ls'}
      ]

      const ls = arr2[1]

      // console.log(arr2.indexOf({name: 'ls'}))
      // console.log(arr2.indexOf(ls))

      // console.log(arr2.includes(ls))
      // console.log(arr2.includes({name: 'ls'}))

      const index = arr2.findIndex(item => {
        if(item.name === 'ls') {
          return true
        }
      })

      console.log(index)
    </script>
  </body>
</html>
